<div id="sidebar" class="page-sidebar">

    <!-- /Page Sidebar Header -->
    <!-- Sidebar Menu -->
    <ul class="nav sidebar-menu">
        <!--Dashboard-->
        {php}$patharray=array(); $actionarray=array(){/php}
        {if C('adminmenu')}
            {foreach C('adminmenu') $adminmenu}
                    <li{if in_array($controller,$adminmenu['id']) && $controller!='index'}{php}$patharray=array('name'=>$adminmenu['name'],'url'=>$adminmenu['url']){/php} class="active open"{elseif in_array($controller,$adminmenu['id']) && $controller=='index'}{php}$patharray=array('name'=>$adminmenu['name'],'url'=>$adminmenu['url']){/php} class="active"{/if}>
                        <a class="menu-dropdown" href="{echo $adminmenu['url']}">
                            <i class="menu-icon {echo $adminmenu['icon']}"></i>
                            <span class="menu-text"> {echo $adminmenu['name']} </span>
                            <i class="menu-expand"></i>
                        </a>
                        
                        {if $adminmenu['submenu']}
                            <ul class="submenu">
                             	{foreach $adminmenu['submenu'] $submenu}
                                    <li{if $controller==$submenu['id']}{php}$actionarray=$submenu['submenu']; $patharray=array('name'=>$submenu['name'],'url'=>$submenu['url']){/php} class="active"{/if}>
                                        <a href="{echo $submenu['url']}">
                                            <span class="menu-text">{echo $submenu['name']}</span>
                                        </a>
                                    </li>
                                {/foreach}
                            </ul>
                        {/if}
                    </li>
              {/foreach}
        {/if}
        
       
    </ul>
    <!-- /Sidebar Menu -->
</div>